package com.hzw.saas.api.user.bo;

import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.Pattern;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hzw.saas.common.util.AccountValidatorUtil;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 用户账户
 *
 * @author zzl
 * @since 01/13/2021
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel("用户账户")
public class UserAccountBO implements Serializable {

    private static final long serialVersionUID = 5640078967647143732L;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID", position = 1)
    private String userId;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "用户名", position = 2)
    private String userName;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", position = 3)
    private String password;

    /**
     * 电话号码
     */
    @ApiModelProperty(value = "电话号码", position = 4)
    @Pattern(regexp = AccountValidatorUtil.REGEX_MOBILE_OR_BLANK, message = "手机号码格式不正确")
    private String phoneNo;

    /**
     * 邮箱地址
     */
    @ApiModelProperty(value = "邮箱地址", position = 5)
    @Pattern(regexp = AccountValidatorUtil.REGEX_EMAIL_OR_BLANK, message = "邮箱格式不正确")
    private String email;

    /**
     * 用户状态 0禁用 1启用
     */
    @ApiModelProperty(value = "用户状态", position = 6)
    private Integer status;

    /**
     * 注册日期
     */
    @ApiModelProperty(value = "注册日期", position = 7)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date registeredDate;


    /**
     * 手机号验证时间
     */
    @ApiModelProperty(value = "手机号验证时间", position = 8, hidden = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date phoneVerifyDate;

    /**
     * 邮箱验证时间
     */
    @ApiModelProperty(value = "邮箱验证时间", position = 9, hidden = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date emailVerifyDate;

}
